//
//  AdvancedIdentify2View.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/11.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "AdvancedIdentify2View.h"
#import <Masonry.h>
@implementation AdvancedIdentify2View

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    NSLog(@"高级认证2/4");
    self.topView = [[UIView alloc] init];
    [self addSubview:self.topView];
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(44);
        make.top.mas_equalTo(0);
    }];
    
    self.tipsLab = [[UILabel alloc] init];
    self.tipsLab.text = @"上传认证拍照";
    self.tipsLab.font = [UIFont boldSystemFontOfSize:18];
    self.tipsLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self.topView addSubview:self.tipsLab];
    [self.tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self.topView);
    }];
    
    self.stypeLab = [[UILabel alloc] init];
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"2/4"];
    [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:91.0f/255.0f green:113.0f/255.0f blue:255.0f/255.0f alpha:1.0f] range:NSMakeRange(0, 1)];
    
    
    [attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:51.0f/255.0f green:51.0f/255.0f blue:51.0f/255.0f alpha:1.0f] range:NSMakeRange(1, 2)];
    self.stypeLab.attributedText = attributedString;
    [self.topView addSubview:self.stypeLab];
    [self.stypeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.topView);
        make.right.mas_equalTo(-15);
    }];
    
    self.frontBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.frontBtn setImage:[UIImage imageNamed:@"renzheng_bg_id_face"] forState:(UIControlStateNormal)];
    [self.frontBtn setImage:[UIImage imageNamed:@"renzheng_bg_id_face"] forState:(UIControlStateHighlighted)];
    [self addSubview:self.frontBtn];
    [self.frontBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(60);
        make.right.mas_equalTo(-60);
        make.top.equalTo(self.topView.mas_bottom).offset(20);
        make.height.equalTo(self.frontBtn.mas_width).multipliedBy(0.6);
    }];
    
    self.frontLab = [[UILabel alloc] init];
    self.frontLab.text = @"上传身份证正面";
    self.frontLab.font = [UIFont systemFontOfSize:14];
    self.frontLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self addSubview:self.frontLab];
    [self.frontLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.frontBtn);
        make.top.equalTo(self.frontBtn.mas_bottom).offset(5);
    }];
    
    
    self.reverseBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.reverseBtn setImage:[UIImage imageNamed:@"renzheng_bg_id_back"] forState:(UIControlStateNormal)];
    [self.reverseBtn setImage:[UIImage imageNamed:@"renzheng_bg_id_back"] forState:(UIControlStateHighlighted)];
    [self addSubview:self.reverseBtn];
    [self.reverseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(60);
        make.right.mas_equalTo(-60);
        make.top.equalTo(self.frontLab.mas_bottom).offset(34);
        make.height.equalTo(self.frontBtn.mas_width).multipliedBy(0.6);
    }];
    
    
    self.reverseLab = [[UILabel alloc] init];
    self.reverseLab.text = @"上传身份证背面";
    self.reverseLab.font = [UIFont systemFontOfSize:14];
    self.reverseLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self addSubview:self.reverseLab];
    [self.reverseLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.reverseBtn);
        make.top.equalTo(self.reverseBtn.mas_bottom).offset(5);
    }];
   
    
}

@end
